﻿<%@ Page Language="C#" Title="" MasterPageFile="~/App_MasterPages/Oceania.Master"
    AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Blog.Net.Blog.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" runat="server">
    <asp:Table runat="server">
        <asp:TableRow runat="server">
            <asp:TableCell runat="server">
                <asp:Repeater ID="blogEntries" runat="server">
                    <ItemTemplate>
                        <div class="post">
                            <p>
                                <h3 class="title">
                                    <%# DataBinder.Eval(Container.DataItem, "Subject") %></h3>
                            </p>
                            <p class="byline">
                                <small>Posted on
                                    <%# DataBinder.Eval(Container.DataItem, "LongCreateDate") %></small></p>
                            <div class="entry">
                                <p>
                                    <%# DataBinder.Eval(Container.DataItem, "ShortBody") %>
                                </p>
                            </div>
                        </div>
                        <blg:Rating EntryId='<%# Eval("Id") %>' runat="server" />
                        <br />
                        <p class="links">
                            <asp:HyperLink NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "Id","~/Blog/BlogEntry.aspx?EntryId={0}") %>'
                                CssClass="more" runat="server">Read More</asp:HyperLink>
                            &nbsp;&nbsp;&nbsp;
                            <asp:HyperLink CssClass="comments" runat="server">No Comments</asp:HyperLink></p>
                        <br />
                        <asp:LoginView ID="AddLoginView" runat="server">
                            <LoggedInTemplate>
                                <asp:HyperLink ID="addEntry" NavigateUrl="~/Blog/BlogEntry.aspx?EntryId=-1" Text="Add"
                                    runat="server" />
                            </LoggedInTemplate>
                        </asp:LoginView>
                    </ItemTemplate>
                </asp:Repeater>
                <asp:LinkButton ID="Previous" OnClick="Previous_Click" Text="Previous" Visible="false"
                    runat="server" />
                <asp:LinkButton ID="Next" OnClick="Next_Click" Text="Next" runat="server" />
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <asp:ObjectDataSource ID="blogs" SelectMethod="GetLatest" DataObjectTypeName="Blog.Net.Business.BusinessObjects.BlogEntryBO"
        TypeName="Blog.Net.DataAccess.DataControls.BlogEntryDataControl" runat="server">
        <SelectParameters>
            <asp:Parameter Name="RecordCount" DefaultValue="5" />
            <asp:QueryStringParameter Name="EntryId" QueryStringField="EntryId" DefaultValue="-1" />
            <asp:QueryStringParameter Name="MonthYear" QueryStringField="Filter" DefaultValue=""
                ConvertEmptyStringToNull="true" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
